import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)
import login from "../views/login/login";
import home from "../views/home/home";
import index from "../views/index";
import user from "../views/user/user";
import bumen from "../views/bumen/bumen";
import notf from "../views/404"
import gongsi from "../views/gongsi/gongsi";
import geren from "../views/geren/geren";
import zhiwei from "../views/zhiwei/zhiwei"
import kehu from "../views/kehu/kehu";
import huifang from "../views/huifang/huifang";
const router = new VueRouter({   //为首页创建一个跳转链接
    mode: 'history',
    routes: [{
        path: '/',   //path为/意思是默认显示
        component: login,
        name: 'login'
    }, {
        path: '/home',
        component: home,
        name: 'home',
        redirect: "/home/index",  //重定向
        children: [{
            path: '/home/index',
            component: index,
            name: 'index',
            meta:{
                title: '统计管理',
                icon: 'pie-chart'
            }
        }, {
            path: '/home/user',
            component: user,
            name: 'user',
            meta:{
                title: '员工管理',
                icon:'user'
            }
        },{
            path: '/home/bumen',
            component: bumen,
            name: 'bumen',
            meta:{
                title: '部门管理',
                icon: 'mouse'
            }
        },{
            path: '/home/company',
            component: gongsi,
            name: 'gongsi',
            meta:{
                title: '公司管理',
                icon: 'coordinate'
            }
        },{
            path: '/home/position',
            component: zhiwei,
            name: 'zhiwei',
            meta:{
                title: '职位管理',
                icon: 'user-solid'
            }
        },{
            path: '/home/customer',
            component: kehu,
            name: 'kehu',
            meta:{
                title: '客户管理',
                icon: 'user-solid'
            }
        },{
            path: '/home/returnvisit',
            component: huifang,
            name: 'huifang',
            meta:{
                title: '回访管理',
                icon: 'user-solid'
            }
        },{
            path: '/home/usercenter',
            component: geren,
            name: 'geren',
            meta:{
                title: '个人中心',
                icon: 'user-solid'
            }
        }]
    }, {
        path: '/404',
        component: notf        //重定向404
    },
        {
            path: '*',
            redirect: "/404"
        }]
})

export default router